package com.jsnkj.basic.bean

import java.io.Serializable

class UserLoginEntity : Serializable {

    /**
     * id : 2
     * parent_id : 1
     * uuid : 07glzP9
     * username : UserB
     * phone :
     * nickname : UserB
     * avatar : http://wz.baiyiadsense.com/images/avatar2.png
     * status : enabled
     * openid : DAZLSKTP1MTZ4
     * registered_at : 2024-05-08 01:37:24
     * last_login_at : 2024-05-08 08:23:47
     * last_login_ip : 123.144.32.79
     * created_at : 2024-05-08 01:37:24
     * updated_at : 2024-05-08 08:23:47
     * parent_uuid : LEgmX4m
     * withdrawable_coins : 12000
     * today_coins : 41000
     */
    var id = 0
    var parent_id = 0
    var uuid: String? = null
    var username: String? = null
    var phone: String? = null
    var nickname: String? = null
    var avatar: String? = null
    var status: String? = null
    var openid: String? = null
    var registered_at: String? = null
    var last_login_at: String? = null
    var last_login_ip: String? = null
    var created_at: String? = null
    var updated_at: String? = null
    var parent_uuid: String? = null
    var ali_login_id: String? = null
    var real_name: String? = null
    var withdrawable_coins: Int = 0
    var today_coins = 0
    var is_group = 0
    var is_show_ad = 1  //0 ：禁用


    fun showName(): String {
        if (nickname.isNullOrEmpty()) {
            return username.toString()
        }
        return nickname!!
    }

    fun isVipGroup(): Boolean { //是否是团长
        return 1 == is_group
    }

    override fun toString(): String {
        return "UserLoginEntity(id=$id, parent_id=$parent_id, uuid=$uuid, username=$username, phone=$phone, nickname=$nickname, avatar=$avatar, status=$status, openid=$openid, registered_at=$registered_at, last_login_at=$last_login_at, last_login_ip=$last_login_ip, created_at=$created_at, updated_at=$updated_at, parent_uuid=$parent_uuid, ali_login_id=$ali_login_id, real_name=$real_name, withdrawable_coins=$withdrawable_coins, today_coins=$today_coins, is_group=$is_group, is_show_ad=$is_show_ad)"
    }


}